﻿@{
    ViewBag.Title = "系统管理";
    Layout = "~/Views/Shared/_Areas_Layout.cshtml";
}

<div class="wrap" style="background-color:#fcfcf9">
    <div class="page-title">
        <span class="modular fl"><i class="user"></i><em>修改密码</em></span>
    </div>
    <form action="@Url.Action("Uppassword", "Admin")" onsubmit="return check()" method="post">
        <table class="noborder">
            <tr>
                <td width="15%" style="text-align:right;">账号：</td>
                <td>
                    <input type="text" name="loginName" class="textBox length-middle" required="required" />
                    <span id="uploginName" style="color: #ff0000; display: none;">*请输入账号！</span>
                </td>
            </tr>
            <tr>
                <td style="text-align:right;">邮箱：</td>
                <td>
                    <input type="text" name="userEmail" class="textBox length-middle" required="required" />
                    <span id="upuserEmail" style="color: #ff0000; display: none;">*请输入邮箱！</span>
                </td>
            </tr>
            <tr>
                <td style="text-align:right;">旧密码：</td>
                <td>
                    <input type="password" name="loginPwd" class="textBox length-middle" required="required" />
                    <span id="uploginPwd" style="color: #ff0000; display: none;">*请输入密码！</span>
                </td>
            </tr>
            <tr>
                <td style="text-align:right;">新密码：</td>
                <td>
                    <input type="password" name="NewloginPwd1" class="textBox length-middle" required="required" />
                    <span id="upNewloginPwd1" style="color: #ff0000; display: none;">*请输入要修改的密码！</span>
                </td>
            </tr>
            <tr>
                <td style="text-align:right;">再次确认密码：</td>
                <td>
                    <input type="password" name="NewloginPwd2" class="textBox length-middle" required="required" />
                    <span id="upNewloginPwd2" style="color: #ff0000; display: none;">*两次密码不一致！</span>
                </td>
            </tr>
            <tr>
                <td style="text-align:right;"></td>
                <td><input type="submit" id="formAdmin" class="tdBtn" value="保存" /></td>
            </tr>
        </table>
    </form>
</div>

<script type="text/javascript">
    function check() {
        var pwd1 = $("[name=NewloginPwd1]").val();
        var pwd2 = $("[name=NewloginPwd2]").val();
        if (pwd1 == "") {
            $("#upNewloginPwd1").css("display", "inline");
            return false;
        } else {
            $("#upNewloginPwd1").css("display", "none");
        }
        if (pwd1 != pwd2) {
            $("#upNewloginPwd2").css("display", "inline");
            return false;
        } else {
            $("#upNewloginPwd2").css("display", "none");
            return true;
        }
    }
    //$(function () {
    //    //焦点事件
    //    $("[name=NewloginPwd2]").focus(function () {
    //        var pwd1 = $("[name=NewloginPwd1]").val();
    //        var pwd2 = $("[name=NewloginPwd2]").val();
    //        if (pwd1 != "" && pwd1 != pwd2) {
    //            $("#upNewloginPwd2").css("display", "inline");
    //        } else {
    //            $("#upNewloginPwd2").css("display", "none");
    //        }
    //    });
    //});
</script>